Defining Desktop Printer Icons for Your Printer Driver
You need to provide six icons for your printer driver: one to represent your driver in the Extensions folder inside of the System folder, and five others to represent different states of the desktop printer. Figure 3-3 shows the six icons for the Apple LaserWriter driver.QuickDraw GX automatically imposes certain status icons over the desktop printer (DTP) icons to indicate certain conditions to the user. The status icons are described
in the next section.Figure 3-3 The Apple LaserWriter printer driver icons
QuickDraw GX uses the printer driver icon to represent the driver in the Extensions folder in the System folder. The desktop printer icons are used to represent different states of the driver when the user has made it a desktop printer.
You need to follow certain guidelines when designing your icons:
- The nonshared, nondefault desktop printer icon is displayed on the desktop when the printer is not the default printer and is not a shared printer. This icon is also used to represent your printer driver in the Chooser.
- The nonshared, default desktop printer icon is displayed on the desktop when the user has selected a nonshared printer as the default printer.
- The shared, nondefault desktop printer icon is displayed on the desktop of both the client and server computers when a shared printer is not the default printer.
- The shared, default desktop printer icon is displayed on the desktop of both the client and server computers when a user has selected a shared printer as the default printer.
- The inactive desktop printer icon is displayed when a desktop printer is not on the startup disk desktop or when QuickDraw GX is not active (for example, if the user has installed QuickDraw GX but has booted the computer with extensions turned off).
One strategy for designing your icons is to design your nondefault desktop printer icons with room for the border that is added for their "default" versions. This simplifies your design process and provides the user with icons that have a consistent appearance and are not distorted.
- Each default desktop printer icon must resemble the icon for the corresponding nondefault desktop printer icon and must have a bold (3 pixels wide) outline drawn around it.
- Each shared desktop printer icon must resemble the printing device with networking cables slightly overlapping at the bottom of the printing device.
- The inactive desktop printer icon must resemble the nonshared, nondefault desktop printer icon and must have bold (3 pixels wide) crossing lines drawn over it.
You need to carefully place the network cables in your shared desktop printer icons because of how they appear when the status icons are overlaid on them. The status icons are more noticeable when the cables are up one pixel from the edge and when the "Y" area of the cables are located in the right half of the icon space. The status icons are described in the next section.
The Desktop Printer Status Icons
QuickDraw GX uses the desktop-printer status icons to convey additional printing information to the user. These are stand-alone icons that are imposed on the lower-left quadrant of the desktop printer icons whenever the status of a desktop printer changes. Each of the status icons is designed with unique color characteristics to help visually distinguish them. Figure 3-4 shows the QuickDraw GX desktop-printer status icons.Figure 3-4 The QuickDraw GX desktop-printer status icons
When a desktop printer is available but not currently being used, the desktop printer icon is displayed without any status added. QuickDraw GX automatically adds the status icon whenever the printer's status changes, as follows:
You provide four desktop printer icons for your printer driver, and QuickDraw GX automatically overlays six different icons on them to convey status information. This means that a desktop printer can be represented on the user's desktop by 28 different icons, as shown in Figure 3-5.
- When one of the user's documents is printing on the desktop printer, the "document is printing" status icon is overlaid on the desktop printer icon.
- When one of the user's documents has finished printing on the desktop printer, the "document is done printing" status icon is overlaid on the desktop printer icon.
- When a shared desktop printer is printing a document that was sent to it by another user, the "another user is printing" status icon is overlaid on the desktop printer icon.
- When a desktop printer requires user attention for conditions such as paper jams or an empty paper tray, the "printer alert" status icon is overlaid on the desktop printer icon.
- When the desktop printer server cannot be found on the network, the "server not found" status icon is overlaid on the desktop printer icon.
- When the user chooses the Stop Printer Queue item in the Printing menu, the
"printer queue stopped" status icon is overlaid on the desktop printer icon.
Figure 3-5 Desktop printer icons showing printer status
Bundling Your Printer Driver Icons
You need to create a bundle ('BNDL'
) resource for your printer driver, just as you do for any Macintosh application program. The bundle resource, which is described in Inside Macintosh: Macintosh Toolbox Essentials, associates your printer driver with its icons and with any files that it creates.QuickDraw GX needs to map the local IDs of your desktop printer icons (which are described in the previous section) into specific IDs to properly use them. For this to happen, you must define a file reference (
'FREF'
) resource for each type of desktop printer icon that you include with your driver. The file types listed in Table 3-11 must be used as shown.The bundle resource for the ImageWriter II printer driver defines the local ID and file reference IDs for each of the desktop printer icon definitions that follow. The resource definition is shown in Listing 3-31.
Listing 3-31 The bundle resource for the ImageWriter II printer driver
resource 'BNDL' (gxPrintingDriverBaseID + 1, sysHeap, purgeable) { kCreatorType, 0, { 'ICN#', { 0, gxPrintingDriverBaseID + 2; 1, gxPrintingDriverBaseID + 3; 2, gxPrintingDriverBaseID + 4; 3, gxPrintingDriverBaseID + 5 }, 'FREF', { 0, gxPrintingDriverBaseID + 2; 1, gxPrintingDriverBaseID + 3; 2, gxPrintingDriverBaseID + 4; 3, gxPrintingDriverBaseID + 5; 0, gxPrintingDriverBaseID + 1 } } };The ImageWriter II printer driver includes a file reference resource for its file type signature and one file reference resource for each type of desktop printer icon, as shown in Listing 3-32.Listing 3-32 The file reference resources for the ImageWriter II printer driver
resource 'FREF' (gxPrintingDriverBaseID + 1, sysHeap, purgeable) { kFileType, 0, "" }; resource 'FREF' (gxPrintingDriverBaseID + 2, sysHeap, purgeable) { 'dpnn', 0, "" }; resource 'FREF' (gxPrintingDriverBaseID + 3, sysHeap, purgeable) { 'dpns', 1, "" }; resource 'FREF' (gxPrintingDriverBaseID + 4, sysHeap, purgeable) { 'dpcn', 2, "" }; resource 'FREF' (gxPrintingDriverBaseID + 5, sysHeap, purgeable) { 'dpcs', 3, "" };The ImageWriter II printer driver defines icons in various sizes and resolution for display on the user's desktop. Note that each related icon (the various sizes and resolutions for each purpose) shares the same resource ID. For example, each of the icons used to represent a desktop printer that is shared and default ('dpcs'
) has resource IDgxPrintingDriverBaseID + 5
, as shown in Listing 3-33. The actual data for the icons can be found in the QuickDraw GX sample code.Listing 3-33 The icon resources for the ImageWriter II printer driver
/* Icons in various sizes and resolutions for the different representations of the desktop printer are included here. */ /* nonshared, nondefault desktop printer icon definitions*/ resource 'ics#' (gxPrintingDriverBaseID + 2, sysHeap, purgeable) { /* icon resource goes here */ }; resource 'ics4' (gxPrintingDriverBaseID + 2, sysHeap, purgeable) { /* icon resource goes here */ }; resource 'ics8' (gxPrintingDriverBaseID + 2, sysHeap, purgeable) { /* icon resource goes here */ }; resource 'ICN#' (gxPrintingDriverBaseID + 2, sysHeap, purgeable) { /* icon resource goes here */ }; resource 'icl4' (gxPrintingDriverBaseID + 2, sysHeap, purgeable) { /* icon resource goes here */ }; resource 'icl8' (gxPrintingDriverBaseID + 2, sysHeap, purgeable) { /* icon resource goes here */ }; /* nondefault, shared desktop printer icon definitions*/ resource 'ICN#' (gxPrintingDriverBaseID + 3, sysHeap, purgeable) { /* icon resource goes here */ }; resource 'icl4' (gxPrintingDriverBaseID + 3, sysHeap, purgeable) { /* icon resource goes here */ }; resource 'icl8' (gxPrintingDriverBaseID + 3, sysHeap, purgeable) { /* icon resource goes here */ }; /* default, nonshared desktop printer icons */ resource 'ICN#' (gxPrintingDriverBaseID + 4, sysHeap, purgeable) { /* icon resource goes here */ }; resource 'icl4' (gxPrintingDriverBaseID + 4, sysHeap, purgeable) { /* icon resource goes here */ }; resource 'icl8' (gxPrintingDriverBaseID + 4, sysHeap, purgeable) { /* icon resource goes here */ }; /* default, shared desktop printer icon definitions*/ resource 'ICN#' (gxPrintingDriverBaseID + 5, sysHeap, purgeable) { /* icon resource goes here */ }; resource 'icl4' (gxPrintingDriverBaseID + 5, sysHeap, purgeable) { /* icon resource goes here */ }; resource 'icl8' (gxPrintingDriverBaseID + 5, sysHeap, purgeable) { /* icon resource goes here */ };
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help